package com.aimaterials.resource.service.impl;

import java.util.List;
import com.aimaterials.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.aimaterials.resource.mapper.ResPointMapper;
import com.aimaterials.resource.domain.ResPoint;
import com.aimaterials.resource.service.IResPointService;

/**
 * 知识点Service业务层处理
 * 
 * @author DaemonSu
 * @date 2020-11-05
 */
@Service
public class ResPointServiceImpl implements IResPointService 
{
    @Autowired
    private ResPointMapper resPointMapper;

    /**
     * 查询知识点
     * 
     * @param pointId 知识点ID
     * @return 知识点
     */
    @Override
    public ResPoint selectResPointById(Long pointId)
    {
        return resPointMapper.selectResPointById(pointId);
    }

    /**
     * 查询课程知识点
     *
     * @param courseId 课程ID
     * @return 知识点
     */
    @Override
    public List<ResPoint> selectCoursePointById(Long courseId) {
        return resPointMapper.selectCoursePointById(courseId);
    }

    /**
     * 查询知识点列表
     * 
     * @param resPoint 知识点
     * @return 知识点
     */
    @Override
    public List<ResPoint> selectResPointList(ResPoint resPoint)
    {
        return resPointMapper.selectResPointList(resPoint);
    }

    /**
     * 新增知识点
     * 
     * @param resPoint 知识点
     * @return 结果
     */
    @Override
    public int insertResPoint(ResPoint resPoint)
    {
        resPoint.setCreateTime(DateUtils.getNowDate());
        return resPointMapper.insertResPoint(resPoint);
    }

    /**
     * 修改知识点
     * 
     * @param resPoint 知识点
     * @return 结果
     */
    @Override
    public int updateResPoint(ResPoint resPoint)
    {
        resPoint.setUpdateTime(DateUtils.getNowDate());
        return resPointMapper.updateResPoint(resPoint);
    }

    /**
     * 批量删除知识点
     * 
     * @param pointIds 需要删除的知识点ID
     * @return 结果
     */
    @Override
    public int deleteResPointByIds(Long[] pointIds)
    {
        return resPointMapper.deleteResPointByIds(pointIds);
    }

    /**
     * 删除知识点信息
     * 
     * @param pointId 知识点ID
     * @return 结果
     */
    @Override
    public int deleteResPointById(Long pointId)
    {
        return resPointMapper.deleteResPointById(pointId);
    }
}
